#ifndef __SDL_STAT_TEXT_HPP
#define __SDL_STAT_TEXT_HPP

#include "SDL.h"
#include <string>

#include "sdltext.hpp"

#include <iostream>

class sdlStaticText
{
private:
    SDL_Surface *theScreen;
    std::string  theLabel;
    SDL_Rect     theRect;
    SDL_Color    theForegroundColor;

public:
    sdlStaticText()
    {
        theScreen = NULL;
        theLabel  = "";
        theRect.x = -1;
        theRect.y = -1;
        theRect.w = 0;
        theRect.h = 0;
        theForegroundColor.r = 255;
        theForegroundColor.g = 255;
        theForegroundColor.b = 255;
    }

//TODO:  Finish implementing foreground and background color
    sdlStaticText( SDL_Surface       *parent,
                   const SDL_Rect    &aRect,
                   const std::string &label = "" )
    {
        theScreen = parent;
        theRect   = aRect;
        theLabel  = label;
        theForegroundColor.r = 123;
        theForegroundColor.g = 212;
        theForegroundColor.b = 150;
    }

    void update()
    {
        SDL_UpdateRect( theScreen, theRect.x, theRect.y, theRect.w, theRect.h );
        //SDL_Flip( theScreen );
    }

    void clear()
    {
        SDL_FillRect(theScreen, &theRect, SDL_MapRGB(theScreen->format, 3, 100, 180));
    }

    void draw()
    {
        clear();
        sdlTextEngine::getInstance().renderTextToSurface( theScreen, theRect, theLabel.c_str() );
        update();
    }
};

#endif //__SDL_STAT_TEXT_HPP
